﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StoreOnlineEntity.Attributes;

namespace StoreOnlineEntity.Entitys
{
    class Role
    {
        private long id;
        [ColumnAttribute(DataType = "bigint", NotNull = true, PrimaryKey = true)]
        public long ID
        {
            get { return id; }
            set { id = value; }
        }

        private string name;
        [ColumnAttribute(DataType = "string", NotNull = true, Length=30)]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private bool isInsert;
        [ColumnAttribute(DataType = "boolean", NotNull = false)]
        public bool IsInsert
        {
            get { return isInsert; }
            set { isInsert = value; }
        }

        private bool isUpdate;
        [ColumnAttribute(DataType = "boolean", NotNull = false)]
        public bool IsUpdate
        {
            get { return isUpdate; }
            set { isUpdate = value; }
        }

        private bool isDelete;
        [ColumnAttribute(DataType = "boolean", NotNull = false)]
        public bool IsDelete
        {
            get { return isDelete; }
            set { isDelete = value; }
        }

        private bool isView;
        [ColumnAttribute(DataType = "boolean", NotNull = false)]
        public bool IsView
        {
            get { return isView; }
            set { isView = value; }
        }

        private List<MethodPermission> methodPermissions;
        [ColumnAttribute(Name = "PermissionID", DataType = "bigint", NotNull = false, ForeinKey = true)]
        public List<MethodPermission> MethodPermissions
        {
            get { return methodPermissions; }
            set { methodPermissions = value; }
        }

        private DateTime lastedModify;
        [ColumnAttribute(DataType = "datetime", NotNull = false)]
        public DateTime LastedModify
        {
            get { return lastedModify; }
            set { lastedModify = value; }
        }

        private User lastedUser;
        [ColumnAttribute(Name="UserID", DataType = "bigint", NotNull = false, ForeinKey=true)]
        public User LastedUser
        {
            get { return lastedUser; }
            set { lastedUser = value; }
        }
    }
}
